<?php
include("../utility/connection.php");
include("../model/mSeminar.php");
session_start();

if($_SERVER["REQUEST_METHOD"] == "POST") {
    $TopikId = trim(mysql_real_escape_string($_POST["hidIdTopik"]));
    $result = fnSelectSeminar($TopikId);
    $count = mysql_num_rows($result); // number of row
    $seminarResult = mysql_fetch_array($result);
    
    if ($count == 1) {
        $_SESSION['topikId']=$TopikId;
        $_SESSION['seminarResult']=$seminarResult;
        header("location: ../ui/admin/seminarAdmin.php");
    } else {
        $_SESSION['topikId']=$TopikId;
        unset($_SESSION['seminarResult']);
        header("location: ../ui/admin/seminarAdmin.php");
    }
}
?>
